package net.sourceforge.wurfl.core.handlers;

import org.apache.commons.lang.StringUtils;

import net.sourceforge.wurfl.core.request.normalizer.UserAgentNormalizer;

/**
 * 
 * @author WURFL-PRO SRL, Rome, Italy
 *
 */
public class BotHandler extends Handler {

	private static final String[] bots = new String[]{"Bot","Crawler","Novarra","Transcoder"};
	
	public BotHandler(UserAgentNormalizer normalizer) {
		super(normalizer);
	}

	public boolean canHandle(String userAgent) {
		boolean handles = false;
		for (int i=0;i<bots.length;i++) {
			if (StringUtils.containsIgnoreCase(userAgent, bots[i])) {
				handles = true;
				break;
			}
		}
		return handles;
	}

}
